/*
 * @Author: your name
 * @Date: 2021-08-24 15:31:36
 * @LastEditTime: 2021-08-26 21:47:40
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \bigdate\src\store\index.ts
 */
import { State } from '../ntils/hooks'
// 导入模块
import user from './module/user'
import { Menu, RoleEnum } from '../router/type'
import { LAYOUT } from '../router/contants'
import { createStore, Store } from 'vuex'
import { ROOT_ROUTER, PAGE_NOT_FOUND, LOGIN_PAGE } from './moudule/baseic'
/**
 * 
 * Pinia 是一个用于 Vue 的状态治理库，相似 Vuex, 是 Vue 的另一种状态治理计划
   Pinia 反对 Vue2 和 Vue3
 */

import { ROOT_ROUTER } from '../router/moudule/baseic'
import { InjectionKey, InjectionKey } from 'vue'
//  这里是测试路由  用户登录 之后

export const key: InjectionKey<Store<State>> = Symbol()
export const store = createStore<State>({
    state() {
        return {
            userinfo: ['asdasd'],
            routerArr: [],
        }
    },
    mutations: {
        // 整体页面需要等 路由获取到之后才能进入 
        FilterRouter(state, val) {
            state.routerArr = []  
        },
    },
    modules: {
        user,
    },
})
